#include <my_header.h>
int get_last_segment(const char* path,char* ret) {
    char buffer[1024];
    strncpy(buffer, path, sizeof(buffer)-1);
    buffer[sizeof(buffer)-1] = '\0';
    
    char *last = NULL;
    char *token = strtok(buffer, "/");
    
    while (token != NULL) {
        last = token;  // 始终保存当前令牌
        token = strtok(NULL, "/");
    }
    strcpy(ret, last);
    return 0;
}
